[SPARK-57883][CORE][TESTS] Fix PluginContainerSuite to check executor memory correctly#56964
[SPARK-57883][CORE][TESTS] Fix PluginContainerSuite to check executor memory correctly#56964dongjoon-hyun wants to merge 1 commit into
PluginContainerSuite to check executor memory correctly#56964Conversation
…or memory correctly
|
Could you review this PR when you have some time, @viirya ? I decided to fix this bug first from |
viirya
left a comment
There was a problem hiding this comment.
+1, LGTM. Verified the root cause independently: getExecutorInfos goes through AppStatusStore.executorList(true), which reads base.index("active").reverse().first(true).last(true) — within the index, entries sort by executor id, so after reverse() the "driver" entry (letters sort after digits) comes first and .head was indeed always the driver. The old assertion only stayed green because the driver happened to carry the same off-heap value, so the executor side was never actually verified.
The eventually is necessary rather than just defensive: waitUntilExecutorsUp only guarantees the executor entry exists (from onExecutorAdded), while memoryMetrics is populated later when the executor's BlockManager registers, so the first read can legitimately see None.
With this fixed, the test genuinely verifies that plugin-set off-heap settings reach the executors — which also makes it a useful guard for #56945.
|
Thank you, @viirya ! |
|
Since this is a test suite only change and I verified locally like the following, I'm going to merge. |
…r memory correctly ### What changes were proposed in this pull request? This PR aims to fix `PluginContainerSuite` to check executor memory correctly. ### Why are the changes needed? Previously, it checks `driver` accidentally because it didn't filter out driver from the executor list. https://github.com/apache/spark/blob/e3e6d9eb31012244692c043eb92a582ae3c3751b/core/src/test/scala/org/apache/spark/internal/plugin/PluginContainerSuite.scala#L261-L263 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #56964 from dongjoon-hyun/SPARK-57883. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 17e7e14) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
This PR aims to fix
PluginContainerSuiteto check executor memory correctly.Why are the changes needed?
Previously, it checks
driveraccidentally because it didn't filter out driver from the executor list.spark/core/src/test/scala/org/apache/spark/internal/plugin/PluginContainerSuite.scala
Lines 261 to 263 in e3e6d9e
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass the CIs.
Was this patch authored or co-authored using generative AI tooling?
No.